package com.fr.report.core.barcode;

import com.fr.report.core.barcode.output.AbstractOutput;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class CompositeModule extends Module
{
  private final List modules = new ArrayList();

  public CompositeModule()
  {
    super(new int[0]);
  }

  public void add(Module paramModule)
  {
    this.modules.add(paramModule);
  }

  public int size()
  {
    return this.modules.size();
  }

  public Module getModule(int paramInt)
  {
    return ((Module)this.modules.get(paramInt));
  }

  public String getSymbol()
  {
    StringBuffer localStringBuffer = new StringBuffer();
    Iterator localIterator = this.modules.iterator();
    while (localIterator.hasNext())
    {
      Module localModule = (Module)localIterator.next();
      localStringBuffer.append(localModule.getSymbol());
    }
    return localStringBuffer.toString();
  }

  protected double draw(AbstractOutput paramAbstractOutput, double paramDouble1, double paramDouble2)
  {
    double d1 = 0.0D;
    double d2 = paramDouble1;
    Iterator localIterator = this.modules.iterator();
    while (localIterator.hasNext())
    {
      Module localModule = (Module)localIterator.next();
      double d3 = localModule.draw(paramAbstractOutput, d2, paramDouble2);
      d2 += d3;
      d1 += d3;
    }
    return d1;
  }
}